{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "00_Notebooks",
      "provenance": [],
      "collapsed_sections": [],
      "toc_visible": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "pa5_r2M_ZzLG",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://practicalai.me\"><img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/rounded_logo.png\" width=\"100\" align=\"left\" hspace=\"20px\" vspace=\"20px\"></a>\n",
        "\n",
        "<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/00_Notebooks/colab.png\" width=\"200\" vspace=\"20px\" hspace=\"20px\" align=\"right\">\n",
        "\n",
        "<div align=\"left\">\n",
        "<h1>Notebook Basics</h1>\n",
        "\n",
        "In this lesson we'll learn how to work with **notebooks**. Notebooks enable interactive and visual computing which makes it a great learning tool. We'll use notebooks to code in Python and learn the basics of machine learning.\n",
        "</div>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "orR8HhgnPY1U",
        "colab_type": "text"
      },
      "source": [
        "<table align=\"center\">\n",
        "  <td>\n",
        "<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/rounded_logo.png\" width=\"25\"><a target=\"_blank\" href=\"https://practicalai.me\"> View on practicalAI</a>\n",
        "  </td>\n",
        "  <td>\n",
        "<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/colab_logo.png\" width=\"25\"><a target=\"_blank\" href=\"https://colab.research.google.com/github/practicalAI/practicalAI/blob/master/notebooks/00_Notebooks.ipynb\"> Run in Google Colab</a>\n",
        "  </td>\n",
        "  <td>\n",
        "<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/github_logo.png\" width=\"22\"><a target=\"_blank\" href=\"https://github.com/practicalAI/practicalAI/blob/master/notebooks/00_Notebooks.ipynb\"> View code on GitHub</a>\n",
        "  </td>\n",
        "</table>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "-Nsq7J22UOGO",
        "colab_type": "text"
      },
      "source": [
        "# Set Up"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Re6q2zNfUGJw",
        "colab_type": "text"
      },
      "source": [
        "1. Sign into your [Google](https://accounts.google.com/signin) account to start using the notebook. If you don't want to save your work, you can skip the steps below.\n",
        "2. If you do want to save your work, click the **COPY TO DRIVE** button on the toolbar. This will open a new notebook in a new tab.\n",
        "\n",
        "<div align=\"left\">\n",
        "&emsp;&emsp;<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/00_Notebooks/copy_to_drive.png\" width=\"320\">\n",
        "</div>\n",
        "\n",
        "3. Rename this new notebook by removing the words `Copy of` from the title (change \"`Copy of 00_Notebooks`\" to \"`00_Notebooks`\").\n",
        "\n",
        "<div align=\"left\">\n",
        "&emsp;&emsp;<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/00_Notebooks/rename.gif\" width=\"320\">\n",
        "</div>\n",
        "\n",
        "4. Now you can run the code, make changes and it's all saved to your personal Google Drive.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "cOEaLCZAu4JQ",
        "colab_type": "text"
      },
      "source": [
        "# Types of cells"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "WcOgqq5xvtMn",
        "colab_type": "text"
      },
      "source": [
        "Notebooks are made up of cells. Each cell can either be a **code cell** or a **text cell**. \n",
        "\n",
        "*   **code cell**: used for writing and executing code.\n",
        "*   **text cell**: used for writing text, HTML, Markdown, etc.\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "tBVFofpLutnn",
        "colab_type": "text"
      },
      "source": [
        "# Creating cells"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "CfSTXDx9LClf",
        "colab_type": "text"
      },
      "source": [
        "First, let's create a text cell. Click on a desired location in the notebook and create the cell by clicking on the **➕TEXT** (located in the top left corner). \n",
        "\n",
        "<div align=\"left\">\n",
        "<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/00_Notebooks/add_text.png\" width=\"320\">\n",
        "<div align=\"left\">\n",
        "\n",
        "Once you create the cell, click on it and type the following text inside it:\n",
        "\n",
        "\n",
        "```\n",
        "### This is a header\n",
        "Hello world!\n",
        "```"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "2O5EqrqbWBlH",
        "colab_type": "text"
      },
      "source": [
        "### This is a header\n",
        "Hello world!"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "iXYgZpgpYS3N",
        "colab_type": "text"
      },
      "source": [
        "# Running cells"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "8og2NZxaO7Nj",
        "colab_type": "text"
      },
      "source": [
        "Once you type inside the cell, press the **SHIFT** and **RETURN** (enter key) together to run the cell."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "WKTbiBuvYexD",
        "colab_type": "text"
      },
      "source": [
        "# Editing cells"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "J_kM3zBEO9Zp",
        "colab_type": "text"
      },
      "source": [
        "To edit a cell, double click on it and make any changes."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Jv0ZSuhNYVIU",
        "colab_type": "text"
      },
      "source": [
        "# Moving cells"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "pv3XtKpLPAY6",
        "colab_type": "text"
      },
      "source": [
        "Once you create the cell, you can move it up and down by clicking on the cell and then pressing the ⬆️ and ⬇️ button on the top right of the cell. \n",
        "\n",
        "<div align=\"left\">\n",
        "<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/00_Notebooks/move_cells.png\" width=\"500\">\n",
        "</div>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "B_VGiYf8YXiU",
        "colab_type": "text"
      },
      "source": [
        "# Deleting cells"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "vKrqxJEmTfQU"
      },
      "source": [
        "You can delete the cell by clicking on it and pressing the trash can button 🗑️ on the top right corner of the cell. Alternatively, you can also press ⌘/Ctrl + M + D.\n",
        "\n",
        "<div align=\"left\">\n",
        "<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/00_Notebooks/delete_cells.png\" width=\"500\">\n",
        "</div>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "hxl7Fk8LVQmR",
        "colab_type": "text"
      },
      "source": [
        "# Creating a code cell\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "lnvxXte0PB0p",
        "colab_type": "text"
      },
      "source": [
        "You can repeat the steps above to create and edit a *code* cell. You can create a code cell by clicking on the ➕CODE (located in the top left corner).\n",
        "\n",
        "<div align=\"left\">\n",
        "<img src=\"https://raw.githubusercontent.com/practicalAI/images/master/images/00_Notebooks/add_code.png\" width=\"320\">\n",
        "</div>\n",
        "\n",
        "Once you've created the code cell, double click on it, type the following inside it and then press `Shift + Enter` to execute the code.\n",
        "\n",
        "```\n",
        "print (\"Hello world!\")\n",
        "```"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "DfGf9KmQ3DJM",
        "colab_type": "code",
        "outputId": "2ec9fcb8-e2e9-4b65-e27f-f6229d77c3c0",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "print (\"Hello world!\")"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Hello world!\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "r2w9xzDkuAXw",
        "colab_type": "text"
      },
      "source": [
        "These are the basic concepts you'll need to use these notebooks but we'll learn few more tricks in subsequent lessons."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "MeE6daOaK8rb",
        "colab_type": "text"
      },
      "source": [
        "---\n",
        "<div align=\"center\">\n",
        "\n",
        "Subscribe to our <a href=\"https://practicalai.me/#newsletter\">newsletter</a> and follow us on social media to get the latest updates!\n",
        "\n",
        "<a class=\"ai-header-badge\" target=\"_blank\" href=\"https://github.com/practicalAI/practicalAI\">\n",
        "              <img src=\"https://img.shields.io/github/stars/practicalAI/practicalAI.svg?style=social&label=Star\"></a>&nbsp;\n",
        "            <a class=\"ai-header-badge\" target=\"_blank\" href=\"https://www.linkedin.com/company/practicalai-me\">\n",
        "              <img src=\"https://img.shields.io/badge/style--5eba00.svg?label=LinkedIn&logo=linkedin&style=social\"></a>&nbsp;\n",
        "            <a class=\"ai-header-badge\" target=\"_blank\" href=\"https://twitter.com/practicalAIme\">\n",
        "              <img src=\"https://img.shields.io/twitter/follow/practicalAIme.svg?label=Follow&style=social\">\n",
        "            </a>\n",
        "              </div>\n",
        "\n",
        "</div>"
      ]
    }
  ]
}